package com.knowledge.action;
import java.util.ArrayList;
import java.util.List;

import com.knowledge.DAO.KnowledgeDAO.DataSource;
import com.knowledge.model.Knowledge;
import com.opensymphony.xwork2.ActionSupport;


@SuppressWarnings("serial")
public class ListAction extends ActionSupport{
	List<Knowledge> knowledgelist = new ArrayList<Knowledge>();
	private String user = null;
	private String userId;

	public List<Knowledge> getKnowledgelist() {
		return knowledgelist;
	}

    public void setKnowledgelist(List<Knowledge> knowledgelist) {
		this.knowledgelist = knowledgelist;
	}
    
	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String execute() throws Exception
	{
		
		
		this.user = "own";
		
        knowledgelist=DataSource.queryOwnList(userId);
		
		return "success";
	}
	

}
